﻿/*
// Exepack.NET compressor
// http://www.codeplex.com/exepack
//
// Menu item attribute
// Written by Y [14-02-09]
// Copyright (c) 2008-2010 Alexey Yakovlev
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Exepack
{
	/// <summary>
	/// Associates method with a menu item
	/// Method should match EventHandler delegate signature
	/// </summary>
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	class MenuItemAttribute : Attribute
	{
		private MenuItemAttribute()
		{
			Path = null;
			Hint = null;
			Image = null;
		}

		public MenuItemAttribute(params string[] path)
		{
			Path = path;
		}

		public string[] Path { get; set; }

		public string Name
		{
			get
			{
				if (Path == null || Path.Length < 1)
					return null;

				return Path[Path.Length - 1];
			}
		}

		public string Hint { get; set; }

		public string Image { get; set; }

		public string Menu { get; set; }

		public bool Separated { get; set; }
	}
}
